Skip to content

reverseproxy: Fix active health check header canonicalization, refactor#5446

Merged
mholt merged 1 commit intomasterfrom
active-health-check-headers
May 5, 2023
Merged

reverseproxy: Fix active health check header canonicalization, refactor#5446
mholt merged 1 commit intomasterfrom
active-health-check-headers

Conversation

@francislavoie
Copy link
Member

Fix #5444

@francislavoie francislavoie requested a review from mholt March 19, 2023 19:39
@francislavoie francislavoie added the bug 🐞 Something isn't working label Mar 19, 2023
@francislavoie francislavoie added this to the v2.7.0 milestone Mar 19, 2023
@francislavoie
Copy link
Member Author

The key here is this chunk of code:

	// Canonicalize the header keys ahead of time, since
	// JSON unmarshaled headers may be incorrect
	cleaned := http.Header{}
	for key, hdrs := range a.Headers {
		for _, val := range hdrs {
			cleaned.Add(key, val)
		}
	}
	a.Headers = cleaned

I also moved the provisioning logic to better localize it in the healthchecks file, moving the provisioning closer to the struct.

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this refactor is a good cleanup. Thank you for the patch!

@mholt mholt merged commit 335cd2e into master May 5, 2023
@francislavoie francislavoie deleted the active-health-check-headers branch May 20, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐞 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Host in health_checks should not require capitalization

2 participants